```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>TCP/IP四层模型详解 - 技术小馆</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background-color: #f8f9fa;
            color: #333;
            line-height: 1.6;
        }
        h1, h2, h3, h4, h5, h6 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 600;
        }
        .hero {
            background: linear-gradient(135deg, #4e54c8 0%, #8f94fb 100%);
            color: white;
        }
        .card {
            transition: all 0.3s ease;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            border-radius: 0.5rem;
            overflow: hidden;
        }
        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
        }
        .layer-card {
            border-left: 4px solid;
            transition: all 0.3s ease;
        }
        .layer-card:hover {
            transform: scale(1.02);
        }
        .network-layer { border-color: #4e54c8; }
        .internet-layer { border-color: #8f94fb; }
        .transport-layer { border-color: #667eea; }
        .application-layer { border-color: #a78bfa; }
        .protocol-item {
            display: flex;
            align-items: center;
            margin-bottom: 0.5rem;
        }
        .protocol-icon {
            margin-right: 0.5rem;
            color: #4e54c8;
        }
        .drop-cap::first-letter {
            font-size: 3em;
            float: left;
            line-height: 0.8;
            margin-right: 0.1em;
            color: #4e54c8;
            font-weight: bold;
        }
        footer {
            background-color: #1a202c;
        }
        footer a:hover {
            color: #8f94fb;
        }
    </style>
</head>
<body class="min-h-screen flex flex-col">
    <!-- Hero Section -->
    <div class="hero py-20 px-4 sm:px-6 lg:px-8 text-center">
        <div class="max-w-4xl mx-auto">
            <h1 class="text-4xl md:text-5xl font-bold mb-4">TCP/IP 四层模型</h1>
            <p class="text-xl md:text-2xl mb-8 opacity-90">网络通信的核心架构与技术实现</p>
            <p class="text-lg md:text-xl max-w-3xl mx-auto drop-cap">TCP/IP 四层模型是一种网络协议分层模型，用于描述计算机网络中的数据传输和通信过程。它是 TCP/IP 协议族的核心组成部分，将网络通信功能分解为不同的层次，每一层都承担特定的功能，以便实现网络数据的可靠传输。</p>
        </div>
    </div>

    <!-- Main Content -->
    <main class="flex-grow container mx-auto px-4 sm:px-6 lg:px-8 py-12">
        <!-- Visualization -->
        <div class="max-w-4xl mx-auto mb-16">
            <h2 class="text-2xl md:text-3xl font-bold mb-6 text-center">TCP/IP 模型层次结构</h2>
            <div class="mermaid">
                graph TD
                    A[应用层] -->|HTTP/FTP/SMTP/DNS| B[传输层]
                    B -->|TCP/UDP| C[网络层]
                    C -->|IP/ICMP/ARP| D[网络接口层]
                    D -->|以太网/Wi-Fi/PPP| E[物理网络]
            </div>
        </div>

        <!-- Layers Section -->
        <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-12">
            <!-- 网络接口层 -->
            <div class="card layer-card network-layer bg-white p-6">
                <div class="flex items-center mb-4">
                    <div class="w-12 h-12 rounded-full bg-blue-100 flex items-center justify-center mr-4">
                        <i class="fas fa-network-wired text-2xl text-blue-600"></i>
                    </div>
                    <h3 class="text-xl font-bold">网络接口层</h3>
                </div>
                <p class="text-gray-600 mb-4">也称为链路层或数据链路层，负责在物理网络中传输数据帧。</p>
                <div class="mb-4">
                    <h4 class="font-semibold mb-2">主要功能：</h4>
                    <ul class="list-disc pl-5 text-gray-700">
                        <li>处理设备到设备之间的物理连接</li>
                        <li>管理数据帧的传输</li>
                        <li>处理MAC地址和链路层协议</li>
                    </ul>
                </div>
                <div>
                    <h4 class="font-semibold mb-2">主要协议：</h4>
                    <div class="protocol-item"><i class="fas fa-ethernet protocol-icon"></i> <span>以太网 (Ethernet)</span></div>
                    <div class="protocol-item"><i class="fas fa-wifi protocol-icon"></i> <span>Wi-Fi</span></div>
                    <div class="protocol-item"><i class="fas fa-link protocol-icon"></i> <span>PPP</span></div>
                </div>
            </div>

            <!-- 网络层 -->
            <div class="card layer-card internet-layer bg-white p-6">
                <div class="flex items-center mb-4">
                    <div class="w-12 h-12 rounded-full bg-indigo-100 flex items-center justify-center mr-4">
                        <i class="fas fa-globe text-2xl text-indigo-600"></i>
                    </div>
                    <h3 class="text-xl font-bold">网络层</h3>
                </div>
                <p class="text-gray-600 mb-4">负责将数据包从源主机传送到目标主机，处理数据包的路由选择。</p>
                <div class="mb-4">
                    <h4 class="font-semibold mb-2">主要功能：</h4>
                    <ul class="list-disc pl-5 text-gray-700">
                        <li>处理IP地址</li>
                        <li>管理不同网络间的数据传输</li>
                        <li>路由选择和寻址</li>
                    </ul>
                </div>
                <div>
                    <h4 class="font-semibold mb-2">主要协议：</h4>
                    <div class="protocol-item"><i class="fas fa-route protocol-icon"></i> <span>IP (IPv4/IPv6)</span></div>
                    <div class="protocol-item"><i class="fas fa-search protocol-icon"></i> <span>ICMP</span></div>
                    <div class="protocol-item"><i class="fas fa-map-marker-alt protocol-icon"></i> <span>ARP</span></div>
                </div>
            </div>

            <!-- 传输层 -->
            <div class="card layer-card transport-layer bg-white p-6">
                <div class="flex items-center mb-4">
                    <div class="w-12 h-12 rounded-full bg-purple-100 flex items-center justify-center mr-4">
                        <i class="fas fa-exchange-alt text-2xl text-purple-600"></i>
                    </div>
                    <h3 class="text-xl font-bold">传输层</h3>
                </div>
                <p class="text-gray-600 mb-4">负责数据的端到端传输，确保数据可靠传输。</p>
                <div class="mb-4">
                    <h4 class="font-semibold mb-2">主要功能：</h4>
                    <ul class="list-disc pl-5 text-gray-700">
                        <li>数据流控制</li>
                        <li>错误检测和纠正</li>
                        <li>确保数据完整性和顺序</li>
                    </ul>
                </div>
                <div>
                    <h4 class="font-semibold mb-2">主要协议：</h4>
                    <div class="protocol-item"><i class="fas fa-shield-alt protocol-icon"></i> <span>TCP</span></div>
                    <div class="protocol-item"><i class="fas fa-bolt protocol-icon"></i> <span>UDP</span></div>
                </div>
            </div>

            <!-- 应用层 -->
            <div class="card layer-card application-layer bg-white p-6">
                <div class="flex items-center mb-4">
                    <div class="w-12 h-12 rounded-full bg-violet-100 flex items-center justify-center mr-4">
                        <i class="fas fa-laptop-code text-2xl text-violet-600"></i>
                    </div>
                    <h3 class="text-xl font-bold">应用层</h3>
                </div>
                <p class="text-gray-600 mb-4">负责应用程序与网络之间的交互，提供网络服务的具体实现。</p>
                <div class="mb-4">
                    <h4 class="font-semibold mb-2">主要功能：</h4>
                    <ul class="list-disc pl-5 text-gray-700">
                        <li>处理用户数据格式</li>
                        <li>提供各种网络服务</li>
                        <li>应用程序接口</li>
                    </ul>
                </div>
                <div>
                    <h4 class="font-semibold mb-2">主要协议：</h4>
                    <div class="protocol-item"><i class="fas fa-globe protocol-icon"></i> <span>HTTP</span></div>
                    <div class="protocol-item"><i class="fas fa-file-upload protocol-icon"></i> <span>FTP</span></div>
                    <div class="protocol-item"><i class="fas fa-envelope protocol-icon"></i> <span>SMTP</span></div>
                    <div class="protocol-item"><i class="fas fa-server protocol-icon"></i> <span>DNS</span></div>
                </div>
            </div>
        </div>

        <!-- Detailed Explanation -->
        <div class="max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
            <div class="p-6 sm:p-8">
                <h2 class="text-2xl font-bold mb-6 text-center">TCP/IP 四层模型详解</h2>
                
                <div class="mb-8">
                    <h3 class="text-xl font-semibold mb-4 text-blue-600">1. 网络接口层</h3>
                    <p class="mb-4">网络接口层是TCP/IP模型中的最底层，直接与物理网络交互。它负责在局域网或广域网的物理网络中传输原始数据帧。</p>
                    <p class="mb-4">这一层的主要任务包括：</p>
                    <ul class="list-disc pl-6 mb-4 space-y-2">
                        <li>定义数据帧格式和物理地址(MAC地址)</li>
                        <li>处理设备到设备的数据传输</li>
                        <li>检测和纠正物理传输错误</li>
                        <li>管理物理介质访问控制</li>
                    </ul>
                    <p>以太网是最常见的网络接口层协议，广泛应用于有线局域网中。Wi-Fi则是无线局域网的实现标准。</p>
                </div>
                
                <div class="mb-8">
                    <h3 class="text-xl font-semibold mb-4 text-indigo-600">2. 网络层</h3>
                    <p class="mb-4">网络层是TCP/IP模型中的关键层，负责数据包的路由和转发，使不同网络间的通信成为可能。</p>
                    <p class="mb-4">主要功能包括：</p>
                    <ul class="list-disc pl-6 mb-4 space-y-2">
                        <li>IP地址分配和逻辑寻址</li>
                        <li>路由选择和最佳路径确定</li>
                        <li>数据包的分片和重组</li>
                        <li>处理网络拥塞</li>
                    </ul>
                    <p>IPv4和IPv6是目前使用的主要IP协议版本，而ICMP则用于网络诊断工具如ping和traceroute。</p>
                </div>
                
                <div class="mb-8">
                    <h3 class="text-xl font-semibold mb-4 text-purple-600">3. 传输层</h3>
                    <p class="mb-4">传输层在端到端通信中起着至关重要的作用，确保数据可靠地从源主机传输到目标主机。</p>
                    <p class="mb-4">它的主要职责是：</p>
                    <ul class="list-disc pl-6 mb-4 space-y-2">
                        <li>建立、维护和终止端到端连接</li>
                        <li>流量控制和拥塞控制</li>
                        <li>错误检测和重传机制</li>
                        <li>多路复用和多路分解</li>
                    </ul>
                    <p>TCP提供可靠的面向连接服务，而UDP则提供轻量级的无连接服务，各有不同的应用场景。</p>
                </div>
                
                <div class="mb-4">
                    <h3 class="text-xl font-semibold mb-4 text-violet-600">4. 应用层</h3>
                    <p class="mb-4">应用层是用户最直接接触的一层，包含了各种网络应用和服务。</p>
                    <p class="mb-4">这一层的特点包括：</p>
                    <ul class="list-disc pl-6 mb-4 space-y-2">
                        <li>提供用户界面和应用程序接口</li>
                        <li>定义数据格式和表示方式</li>
                        <li>实现特定的应用功能</li>
                        <li>处理用户认证和授权</li>
                    </ul>
                    <p>HTTP协议支持万维网，SMTP支持电子邮件传输，DNS实现域名解析，FTP则用于文件传输。</p>
                </div>
            </div>
        </div>
    </main>

    <!-- Footer -->
    <footer class="py-8 text-white">
        <div class="container mx-auto px-4 text-center">
            <p class="mb-2">技术小馆</p>
            <p><a href="http://www.yuque.com/jtostring" class="hover:text-blue-300 transition-colors">http://www.yuque.com/jtostring</a></p>
        </div>
    </footer>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            },
            securityLevel: 'loose'
        });
    </script>
</body>
</html>
```